const bcrypt = require('bcrypt')

// 加密
const myBcrypt = (myPlaintextPassword) => {
  return new Promise((resolve, reject) => {
    bcrypt.hash(myPlaintextPassword, 10, function (err, hash) {
      if (err) {
        return reject(err)
      } else {
        return resolve(hash)
      }
    });
  })
}


module.exports = {
  myBcrypt
}